<template>
  <el-row>
    <el-col :span="24">
      <el-tabs v-model="activeName">
        <el-tab-pane label="订单信息" name="1">
          <keep-alive>
            <order-info v-if="activeName == 1" :detail="detail"></order-info>
          </keep-alive>
        </el-tab-pane>
        <el-tab-pane label="服务信息" name="2">
          <keep-alive>
            <service-info v-if="activeName == 2" :id="id"></service-info>
          </keep-alive>
        </el-tab-pane>
      </el-tabs>
    </el-col>
  </el-row>
</template>
<script>
import OrderInfo from '@/views/oms/orders/serviceOrders/detail/OrderInfo'
import ServiceInfo from '@/views/oms/orders/serviceOrders/detail/ServiceInfo'
import {unixTimestampFilter, filterDataBaseDictionary, decimalNumFilter} from '@/filters'
import FollowUp from '@/views/oms/business/FollowUp'
export default {
  name: 'arriveManagerShow',
  components: {
    FollowUp,
    OrderInfo,
    ServiceInfo
  },
  filters: {
    decimalNumFilter,
    filterDataBaseDictionary,
    unixTimestampFilter
  },
  data() {
    return {
      activeName: this.$route.query.tab ? String(this.$route.query.tab) : '1',
      id: this.$route.params.id,
      detail: {}
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    getDetail() {
      this.$ajax.get('/ms-terminal-order/orderData/getOrderDatails', {orderId: this.id}).then(response => {
        if (!response.data) {
          return
        }
        this.detail = response.data || {}
      })
    }
  }
}
</script>
